package com.blocks.mq.producer.example.controller;

import com.blocks.mq.producer.example.service.ExampleMqService;
import com.zut.blocks.base.mq.Message;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author lxd
 * @date 2020/12/4 23:45
 */
@RestController
public class ExampleController {

    @Resource
    ExampleMqService exampleMqService;


    @GetMapping("/send/database")
    public Message sendDatabase(Integer id) {
        return exampleMqService.sendStudent(id);
    }

    @GetMapping("/send/database/all")
    public List<Message> sendDatabaseAll() {
        return exampleMqService.sendStudentAll();
    }

    @GetMapping("/send/xlsx")
    public Message sendXlsx(String path) {
        return exampleMqService.sendXlsxData(path);
    }

    @GetMapping("/send/txt")
    public Message sendTxt(String path) {
        return exampleMqService.sendTxtData(path);
    }


}
